{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}{\f37\froman\fcharset238\fprq2 Times New Roman CE;}
{\f38\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f40\froman\fcharset161\fprq2 Times New Roman Greek;}{\f41\froman\fcharset162\fprq2 Times New Roman Tur;}{\f42\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
{\f43\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f44\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f45\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f47\fswiss\fcharset238\fprq2 Arial CE;}
{\f48\fswiss\fcharset204\fprq2 Arial Cyr;}{\f50\fswiss\fcharset161\fprq2 Arial Greek;}{\f51\fswiss\fcharset162\fprq2 Arial Tur;}{\f52\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f53\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
{\f54\fswiss\fcharset186\fprq2 Arial Baltic;}{\f55\fswiss\fcharset163\fprq2 Arial (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;
\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{
\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\*\cs10 \additive \ssemihidden 
Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv 
\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}
{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\listtable{\list\listtemplateid1974255890\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698705
\'02\'00);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698713\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698703\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698713\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698715\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698703\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698713\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698715\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid345252170}{\list\listtemplateid-1172014274\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0
\levelfollow0\levelstartat2\levelspace0\levelindent0{\leveltext\leveltemplateid67698705\'02\'00);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0
\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2
\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0
\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0
\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2
\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0
\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0
\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2
\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid413091115}
{\list\listtemplateid-818242084\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698705\'02\'00);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 
\fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 
\fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 
\fi-180\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 
\fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 
\fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 
\fi-180\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 
\fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 
\fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 
\fi-180\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1670937422}{\list\listtemplateid-1537412838\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698705
\'02\'00);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698713\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698703\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698713\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698715\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698703\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698713\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
\leveltemplateid67698715\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1813863346}}{\*\listoverridetable{\listoverride\listid1670937422\listoverridecount0\ls1}
{\listoverride\listid413091115\listoverridecount0\ls2}{\listoverride\listid345252170\listoverridecount0\ls3}{\listoverride\listid1813863346\listoverridecount0\ls4}}{\*\rsidtbl \rsid67697\rsid72793\rsid74230\rsid526446\rsid724261\rsid789204\rsid809905
\rsid881690\rsid918425\rsid946123\rsid1205442\rsid1262823\rsid1900550\rsid2061270\rsid2518787\rsid2575100\rsid2645751\rsid2688957\rsid2826193\rsid2976546\rsid3035161\rsid3243851\rsid3362120\rsid3439844\rsid3487022\rsid3559158\rsid4205449\rsid4357164
\rsid4522808\rsid4605533\rsid4657845\rsid5006855\rsid5012816\rsid5061250\rsid5204372\rsid5655416\rsid6380006\rsid6437630\rsid6711826\rsid7219573\rsid7551062\rsid7559502\rsid7809200\rsid7820144\rsid7830745\rsid7930631\rsid8002588\rsid8074661\rsid8130689
\rsid8347710\rsid8469079\rsid8602399\rsid8615240\rsid8670208\rsid8719616\rsid9076408\rsid9269253\rsid9310934\rsid9707778\rsid9853666\rsid9900640\rsid10051224\rsid10442008\rsid10555277\rsid10694226\rsid10972158\rsid11216095\rsid11225432\rsid11349568
\rsid11606024\rsid11619650\rsid11934694\rsid12003319\rsid12006129\rsid12060511\rsid12061549\rsid12209261\rsid12218367\rsid12472088\rsid12733371\rsid12743627\rsid12869203\rsid13110403\rsid13197133\rsid13201581\rsid13393522\rsid13437022\rsid13440500
\rsid13717494\rsid13718977\rsid14300551\rsid14439167\rsid14568005\rsid14575730\rsid14636831\rsid14813478\rsid15086349\rsid15090718\rsid15139057\rsid15170962\rsid15408614\rsid15419235\rsid15432382\rsid15694911\rsid15819165\rsid15863491\rsid16413042
\rsid16471662\rsid16524088}{\*\generator Microsoft Word 11.0.8134;}{\info{\operator hp hp}{\creatim\yr2008\mo2\dy27\hr13\min7}{\revtim\yr2008\mo5\dy1\hr16\min1}{\version105}{\edmins154}{\nofpages8}{\nofwords1754}{\nofchars9999}{\nofcharsws11730}
{\vern24611}{\*\password 00000000}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\gutter0\ltrsect 
\widowctrl\ftnbj\aenddoc\donotembedsysfont0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3
\jcompress\viewkind4\viewscale100\rsidroot2976546 \fet0{\*\wgrffmtfilter 013f}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2
\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6
\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang 
{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af1\afs32 \ltrch\fcs0 
\f1\fs32\insrsid15419235\charrsid15419235 Information for setting up the techFX Zigbee controllers:}{\rtlch\fcs1 \af1\afs32 \ltrch\fcs0 \f1\fs32\insrsid10442008\charrsid15419235 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid724261 
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid72793 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid72793 In our initial design plan we chose to send data to the Zigbee modules on a preset interval time 
to make sure that the controller's buffers would not get overfilled. After testing this method we saw that some "sync" issues arose where packets could be dropped if the timing between the Windows application sending and our Zigbee receiving packets was n
ot totally correct.
\par 
\par Unfortunately, the complexity of the code needed to make sure that the packets sent were both complete, correct, and fully present in the receive buffer was getting to be quite large. Because of this we undertook a simpler approach that
 has paid dividends in a faster response time and less overall code complexity.
\par 
\par To do so, we keep a temporary array in the controller's memory which stores all bytes sent across the network. When the interrupt function receives the fifth byte in the array
 (signifying a full packet) then the code is deconstructed and sent across the I2C bus to the servo controller. 
\par 
\par This approach also allows us to remove any sort of data sync issues that we had seen before. Whenever both the host and gun controllers were p
owered up we would often have to wait several minutes for packets to be first sent across the network, whereas now the units will work only a few seconds after they are powered on.
\par 
\par The only negative aspect of using the interrupt centric approach chosen ap
pears whenever another interrupt based device (such as the ADC) is called from the function. Since the interrupt code has a high priority interrupt, it overrides any other interrupts that could be called, and thus disables those other modules. 
\par 
\par Whenever a byte is received by the gun controller the following process is implemented in code:
\par 
\par 1) Retrieve the byte from the RCREG register on the Zigbee.
\par 2) Add the byte to the packetBuffer array of bytes.
\par 3) Check if the packetBuffer contains 5 bytes of data. If so, write the data to the servo controller.
\par 
\par When the servo controller write occurs some additional checks happen to see if the gun can fire:
\par 1) Check if the IR comparator circuit is outputting a High voltage. If so, disable the gun movement. If not, enable the gun movement.
\par 2) Check the first byte in the packetBuffer array. This byte contains the data needed to determine if the software says the gun should fire. If the byte equals the hexadecimal value of 0x01 then fire, otherwise the gun should not fire.
\par 3) Enable the firing of the gun.
\par 4) Transmit the X and Y servo data to the servo controller to position the servos.
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs28 \ltrch\fcs0 \b\f1\fs28\insrsid72793 
\par }{\rtlch\fcs1 \af1\afs28 \ltrch\fcs0 \b\f1\fs28\insrsid724261\charrsid526446 Network Packet Information:
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid2826193 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid724261 
We chose to implement the following packet structure that is sent across the network from the host PC to each of the guns that it may be controlling:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6380006 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid2826193 1) }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid724261 Packet is 5 bytes in length
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid526446 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid2826193 2) }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid724261 
First byte specifies if the gun is to fire or not. 0x00 indicates that the gun is to NOT fire while 0x01 indicates that the gun is OK to fire.
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid526446 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid2826193 3) }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid724261 The next four bytes }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5006855 specify}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 
\f1\fs20\insrsid724261  the high and low bytes for each of the X and Y axes. These byte values are computed in our gun processing application and the Xbee has no need to process them except to transmit and parse them to the servo controller.
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6380006 
\par When sent from the Windows application the packet will have an extra header byte that must be equal to 0xAA. This tells the Xbee controller upon transmission that the data sent across the USB bus contains a packet used in controlling the gun.
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 
\par }{\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 \b\f1\fs28\insrsid10442008 Coordinator - Connects to }{\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 \b\f1\fs28\insrsid74230 Gun}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 
\par }{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid10442008 FW notes:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 
\par Coordinator device FW}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid8719616  must be loaded}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 .}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9310934 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 Commands for configuration:
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid11619650 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid11619650\charrsid11619650 void initxbee(void)
\par \{
\par \tab //this is a guard time delay that is required for command mode entry
\par \tab // do not remove
\par \tab for (i=0;i<1060;i++)
\par \tab \{
\par \tab \tab Delay1KTCYx(30);
\par \tab \}
\par 
\par //this is command mode entry command do not remove
\par putrsuart( "+++" );
\par getsuart(temp_buffa,3);
\par 
\par // set channel to C
\par putrsuart("ATSC12\\r");
\par getsuart(temp_buffa,3);
\par 
\par //panid
\par putrsuart("ATID33\\r");
\par getsuart(temp_buffa,3);
\par 
\par //destination low
\par //putrsuart("ATDLH03E11DB\\r");
\par //getsuart(temp_buffa,3);
\par 
\par //destination high
\par //putrsuart("ATDH13A200\\r");
\par //getsuart(temp_buffa,3);
\par 
\par //allow nodes to join at any time
\par putrsuart("ATNJFF\\r");
\par getsuart(temp_buffa,3);
\par 
\par //node identifier for this node
\par putrsuart("ATNIGUN\\r");
\par getsuart(temp_buffa,3);
\par 
\par //exit command mode
\par putrsuart("ATCN\\r");
\par getsuart(temp_buffa,3);
\par \}
\par 
\par //
\par // END xbee init function
\par //}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008\charrsid11619650 
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid10442008 Pin Configuration:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13110403 IO7 \endash  used for }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9076408 IR comparator input}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13110403 Digital }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9076408 Input}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13110403  Pin, Default Low setting
\par 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9076408 IO8}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13110403  \endash  used for }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9076408 firing relay circuit input}{\rtlch\fcs1 
\af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13110403 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9076408 Digital Output}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13110403  Pin, Default Low setting
\par }{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid10442008 
\par Receive Code:}{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid12743627 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid72793 W}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9269253 
e chose to implement the full register range offered by the SD21. This allows us to have a 1000 point range of motion for each servo, which required us to make three writes across the I2C bus for each
 servo movement. To make the servos move, each servo has speed, low byte and high byte registers that must be written to before the controller will refresh the servo\rquote s position. 
\par 
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid13197133 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13197133 //Put into periodic function to execute every 100 milliseconds.
\par //receive packet from the buffer containing x,y for each servo 
\par //1 byte + 1 byte + 1 byte + 1 byte + 1 byte
\par //fire bit specifies if the gun should fire or not
\par //fire bit + servoX1Info(position) + servoX2Info(position) + servoY1Info(position) 
\par }\pard \ltrpar\ql \fi720\li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid13197133 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13197133 + servoY2Info(position)
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13197133\charrsid9269253 
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid5061250 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5061250\charrsid5061250 void interrupthingie(void)
\par \{
\par 
\par \tab if (PIR1bits.RCIF==1)
\par \tab \{
\par \tab \tab //\tab xbee_sleep=0;
\par \tab \tab //\tab while(!xbee_cts);
\par \tab   }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5061250 \tab }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5061250\charrsid5061250 datatemp=RCREG;
\par \tab \tab packetBuffer[packetPosition] = datatemp;
\par \tab \tab packetPosition = ((packetPosition+1) % PACKET_LENGTH);
\par \tab \tab if(packetPosition == 0)
\par \tab \tab \{
\par \tab \tab \tab if((packetBuffer[0] == 0x00) || (packetBuffer[0] == 0x01))
\par \tab \tab \tab \{
\par \tab \tab \tab \tab if(port_to_ascii(IO7) == 0x30)
\par \tab \tab \tab \tab \{
\par \tab \tab \tab \tab \tab fireOK=1;
\par \tab \tab \tab \tab \}
\par \tab \tab \tab \tab else
\par \tab \tab \tab \tab \{
\par \tab \tab \tab \tab \tab fireOK=0;
\par \tab \tab \tab \tab \}
\par 
\par \tab \tab \tab \tab if ((packetBuffer[0] == 0x01) & (fireOK == 1))
\par \tab \tab \tab \tab \{
\par \tab \tab \tab \tab \tab \tab IO8=1;
\par \tab \tab \tab \tab \}
\par \tab \tab \tab \tab else
\par \tab \tab \tab \tab \{\tab 
\par \tab \tab \tab \tab \tab IO8=0;
\par \tab \tab \tab \tab \}
\par \tab \tab \tab if(fireOK == 1)
\par \tab \tab \tab \{
\par \tab \tab \tab //create and send the I2C packet to the Xservo controller
\par \tab \tab \tab //control byte is always 0xC2
\par \tab \tab \tab ControlByte=0xC2;
\par \tab \tab \tab //use register 1 for the low bits of the position
\par \tab \tab \tab HighAdd=0x01;
\par \tab \tab \tab //store the low bits of the data
\par \tab \tab \tab LowAdd=packetBuffer[1];
\par \tab \tab \tab //write the low bits of the data to the register
\par \tab \tab \tab EErombytewrite2(ControlByte,HighAdd,LowAdd);
\par 
\par \tab \tab \tab //control byte is always 0xC2
\par \tab \tab \tab ControlByte=0xC2;
\par \tab \tab \tab //use register 2 for the high bits of servo 1
\par \tab \tab \tab HighAdd=0x02;
\par \tab \tab \tab //store the high bits of the data to the register
\par \tab \tab \tab LowAdd=packetBuffer[2];
\par \tab \tab \tab //write the high bits of the data to the register
\par \tab \tab \tab EErombytewrite2(ControlByte,HighAdd,LowAdd);
\par 
\par \tab \tab \tab //create and send the I2C packet to the Yservo controller
\par \tab \tab \tab //control byte is always 0xC2
\par \tab \tab \tab ControlByte=0xC2;
\par \tab \tab \tab //use register 4 for the low bits of the position
\par \tab \tab \tab HighAdd=0x04;
\par \tab \tab \tab //store the low bits of the data
\par \tab \tab \tab LowAdd=packetBuffer[3];
\par \tab \tab \tab //write the low bits of the data to the register
\par \tab \tab \tab EErombytewrite2(ControlByte,HighAdd,LowAdd);
\par 
\par \tab \tab \tab //control byte is always 0xC2
\par \tab \tab \tab ControlByte=0xC2;
\par \tab \tab \tab //use register 5 for the high bits of servo 1
\par \tab \tab \tab HighAdd=0x05;
\par \tab \tab \tab //store the high bits of the data to the register
\par \tab \tab \tab LowAdd=packetBuffer[4];
\par \tab \tab \tab //write the high bits of the data to the register
\par \tab \tab \tab EErombytewrite2(ControlByte,HighAdd,LowAdd);
\par \tab \tab \tab \}
\par \tab \tab \tab \}\tab 
\par \tab \tab \}\tab \tab 
\par \tab \}
\par \tab \tab 
\par 
\par \tab if (PIR1bits.TMR1IF == 1)    
\par \tab \{ \tab 
\par         WriteTimer1(28100);
\par \tab \tab inctime();
\par  
\par \tab \tab if (!Sbuffer_empty)
\par \tab \tab \{
\par \tab \tab \tab for (m=0;m<5;m++)
\par \tab \tab \tab \{
\par \tab \tab \tab \tab datatemp2=read_sndbuffa();
\par \tab \tab \tab \tab if (datatemp2!=0x00)
\par \tab \tab \tab \tab \{
\par \tab \tab \tab \tab \tab Writeuart_1byte(datatemp2);
\par \tab \tab \tab \tab \}
\par \tab \tab \tab \tab else
\par \tab \tab \tab \tab \{
\par \tab \tab \tab \tab \tab m=5;
\par \tab \tab \tab \tab \}
\par \tab \tab \tab \}
\par \tab \tab \}
\par 
\par \tab //clear timer 1 flag
\par \tab \tab PIR1bits.TMR1IF = 0;                // yes, clear int flag\tab 
\par \tab \}
\par \}}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008\charrsid5061250 
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid10442008 Transmit code:
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13201581 Currently no data is sent back to the host PC.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid15086349 
\par }{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid15086349\charrsid7559502 Current Issues:
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid15086349 Right now we have the following issues with the Xbee controller connected to the gun:
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid10972158 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10972158 1) }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid15086349 
The FW assumes that all data sent across the network is a valid packet. This speeds up processing time but we cannot allow unknown devices to join the network as a possible security risk (as they could inject unwanted packets).
\par }{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\insrsid7559502\charrsid7559502 
\par }{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid7559502\charrsid7559502 I2C code:}{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid7559502 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7559502\charrsid7559502 In order to optimize the speed at which the I2C servo link can operate we set the default bus speed to be 100khz.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7559502 

\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7559502\charrsid7559502 
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid7559502 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7559502\charrsid7559502 void initi2c(void)
\par \{
\par \tab SSPCON1=0x00;
\par \tab SSPSTAT=0x80;\tab \tab \tab \tab // turn off slew rate control for 100k and 1 mhz, turn on for 400k//
\par  \tab //*******************
\par \tab //
\par \tab //I2C speed setting here
\par \tab //
\par \tab //***48 mhz settings***0x1D for 400k...0x0B for 1Mhz...0x77 for 100khz.........///
\par \tab //
\par  \tab SSPADD=0x77; \tab \tab \tab \tab //see above speed guide for 48mhz//
\par \tab //******************
\par     SSPCON1=0x28;\tab \tab \tab \tab //sspen and ssmp: 1 0 0 0 for master i2c mode//
\par     SSPCON2=0x00; \tab \tab \tab \tab //init values//
\par     TRISBbits.TRISB0=1;\tab \tab \tab //make sure port is input//
\par     TRISBbits.TRISB1=1;\tab  \tab \tab //make sure port is input//
\par \}}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7559502\charrsid7559502 
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 
\par }{\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 \b\f1\fs28\insrsid74230 Router}{\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 \b\f1\fs28\insrsid10442008  - Connects to }{\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 \b\f1\fs28\insrsid74230 Host PC}{\rtlch\fcs1 \af1\afs20 
\ltrch\fcs0 \f1\fs20\insrsid10442008 
\par }{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid10442008 FW notes:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 
\par End device FW}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid8719616  must be loaded to the device}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 .
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14636831 The major configuration decision that we made f
or the host PC controller was to make sure that it always runs in a non-idle mode. Xbee controllers are ideally suited to idle at regular intervals to conserve power, but we disabled the sleep mode to ensure that no time is wasted while the controller wak
es up and then goes back to sleep each time data is sent across the network.
\par 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 Commands for configuration:
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid3362120 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid3362120\charrsid3362120 void initxbee(void)
\par \{
\par \tab //this is a guard time delay that is required for command mode entry
\par \tab // do not remove
\par \tab for (i=0;i<1060;i++)
\par \tab \{
\par \tab \tab Delay1KTCYx(30);
\par \tab \}
\par 
\par //this is command mode entry command do not remove
\par putrsuart("+++");
\par getsuart(temp_buffa,3);
\par 
\par // set channel to C
\par putrsuart("ATSC12\\r");
\par getsuart(temp_buffa,3);
\par 
\par //panid
\par putrsuart("ATID33\\r");
\par getsuart(temp_buffa,3);
\par 
\par //change node joining to always
\par putrsuart("ATNJFF\\r");
\par getsuart(temp_buffa,3);
\par 
\par //node identifier for this node
\par putrsuart("ATNIHOST\\r");
\par getsuart(temp_buffa,3);
\par 
\par // turn off sleep mode
\par putrsuart("ATSM0\\r");
\par getsuart(temp_buffa,3);
\par 
\par //save changes
\par //putrsuart("ATWR\\r");
\par //getsuart(temp_buffa,3);
\par 
\par putrsuart("ATDH0\\r");
\par getsuart(temp_buffa,3);
\par 
\par putrsuart("ATDL0\\r");
\par getsuart(temp_buffa,3);
\par 
\par //exit command mode
\par putrsuart("ATCN\\r");
\par getsuart(temp_buffa,3);
\par \}}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008\charrsid3362120 
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 
\par }{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid10442008 Pin Configuration:
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid12006129 The default setting of all pins to be Digital outputs has been implemented since no input or output pins are needed on the host PC.}{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid10442008 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 
\par }{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid10442008 Receive code:
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13197133 No code is received from the gun(s) currently.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1205442 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13197133 
\par }{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid10442008 Transmit code:
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid11216095\charrsid11216095 Insi
de the ServiceRequests() function we added the following code to check and see if the USB command 0xAA has been sent to send a packet across the USB bus to the Xbee controller.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid11216095 
 The controller will send a 0x01 byte back to the PC to indicate that it has received a packet correctly.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid11216095\charrsid11216095 
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid11216095 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478 
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid15090718 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid15090718\charrsid15090718 \tab \tab case gunMove:
\par \tab \tab \tab //copy all of the USB data to the Xbee interface
\par \tab \tab \tab temp_buffa[0]=dataPacket._byte[1];
\par \tab \tab \tab temp_buffa[1]=dataPacket._byte[2];
\par \tab \tab \tab temp_buffa[2]=dataPacket._byte[3];
\par \tab \tab \tab temp_buffa[3]=dataPacket._byte[4];
\par \tab \tab \tab temp_buffa[4]=dataPacket._byte[5];
\par \tab \tab \tab //temp_buffa[5]=dataPacket._byte[6];
\par \tab \tab \tab //write to the Xbee interface
\par \tab \tab \tab putPacket(temp_buffa);
\par 
\par \tab \tab \tab counter=0x06;
\par \tab \tab \tab break;}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478\charrsid15090718 
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid11216095 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid15139057 
\par The putPacket() function looks as follows:
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid15139057 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid15694911 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid15139057\charrsid15139057 void putPacket(char *data)
\par \{
\par \tab for(i=0; i<5; i++)
\par     \{
\par     \tab Writeuart_1byte(*data);
\par         data++;
\par     \}
\par \}
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid11216095 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid15139057 
\par 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478 A modification to user.h had to be made to add the gunMove command to the USB parser:
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid14813478 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478\charrsid14813478 enum
\par         \{
\par \tab \tab \tab gunDisabled}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478 \tab }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478\charrsid14813478  = 0xEE,
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478 \tab \tab \tab gunMove\tab  }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478\charrsid14813478 = 0xAA,
\par \tab \tab \tab bootmodecheck\tab }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478  }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478\charrsid14813478 = 0x44,
\par             }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478 \tab \tab \tab }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478\charrsid14813478 READ_VERSION    = 0x00,
\par \tab \tab \tab getrcv_buffa\tab = 0xA0,
\par            }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478 \tab \tab \tab }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478\charrsid14813478 RESET           = 0xFF
\par         \}CMD;
\par         byte len;}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14813478 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5204372 
\par The following simple function was written to allow for a packet to be sent}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid12061549  with any data contained within:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5204372 
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid5204372 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5204372\charrsid5204372 void putPacket(char *data)
\par \{
\par \tab for(i=0; i<5; i++)
\par     \{
\par     \tab Writeuart_1byte(*data);
\par         data++;
\par     \}
\par \}
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid14813478 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5204372 
\par }{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid5204372\charrsid5204372 Current Issues:}{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid5204372 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5204372 We have the following issues with the Xbee controller connected with the host PC:
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid9900640 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9900640 1) }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5204372 The PC cannot receive any data from the }
{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid15170962 sentry guns.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5204372 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9900640 2) }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5204372 
The TechFX terminal utility cannot be used to communicate with the controller as it interferes with the USB send and receive buffers.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5204372\charrsid5204372 
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\ul\insrsid3243851 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 
\par }{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\insrsid10442008 
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid10442008 
\par 
\par 
\par }}